#include <sourcemod>
#include <sdktools>
//#include <left4downtown>
#undef REQUIRE_PLUGIN

/*UML4D2 includes*/
#include "UMUL4D2_client_validation.sp"	
#include "UMUL4D2_remove_medkits.sp"	
#include "UMUL4D2_display_ads.sp"	
#include "l4d2_bulldozercertificate.sp"	
#include "U10v10_ItemGiver.sp"		
#include "U10v10_MeleeSpawner.sp"	

//new Handle:hOverAllDiffAdj = INVALID_HANDLE;
static SurvCount = 0;
static cTanks = 0;

public Plugin:myinfo = 
{
	name = "10v10 REVOLUT10N",
	author = "MonkeyDrone",
	description = "10v10 Fine-Tuned",
	version = "0.3",
	url = "http://www.piratemelons.com"
};


public OnPluginStart()
{
	HookEvent("map_transition", Transition_Event);
	HookEvent("round_start",Round_Start_Event);
	HookEvent("round_end",Round_End_Event);
	HookEvent("finale_win", Event_FinalWin);
	HookEvent("mission_lost", Event_FinalLost);
	HookEvent("tank_spawn",Tank_Spawn);
	//HookEvent("player_death",Event_Player_Died);
	DisplayAds();
	
}

public Action:cDiffAdj(Handle:Timer){
	
}

public OnMapStart()
{
	MeleeWepCaching();
}

public OnMapEnd()
{

}

public Action:Round_Start_Event(Handle:event, String:event_name[], bool:dontBroadcast)
	{
		RemoveMedsFromRoundStart();		//Removes Medkit from the map on Round Start
		GiveItemOnRoundStart();				//Item Giver on Round Start
		SpawnMeleeWeps_RS();					//Melee Spawner on Round Start
		
		
	}
	
public Action:Round_End_Event(Handle:event, String:event_name[], bool:dontBroadcast)
{

}
	
public Action:Event_FinalWin(Handle:event, String:event_name[], bool:dontBroadcast)
	{

	}		

public Action:Event_FinalLost(Handle:event, String:event_name[], bool:dontBroadcast)
	{
		SurvCount=PlayerCounter();
	}
	
public Action:Transition_Event(Handle:event, String:event_name[], bool:dontBroadcast)
{
	SurvCount=PlayerCounter();
	
}



public PlayerCounter(){
	new PlayCount = 0;
	for (new i_client=1; i_client<=GetMaxClients(); i_client++)
	{
		if(IsValidClient(i_client) && GetClientTeam(i_client) == TEAM_SURVIVOR)
			{
				PlayCount++;
			}
	}
	return PlayCount;
}
